import request from '@/utils/request'


/**
 * 查询权限列表
 */
 export const queryData = () => {
  return request({
    url: '/admin/resource/query',
    method: 'get',
  })
}

/**
 * 查询权限列表
 */
export const getResourceByRoleId = (id) => {
  return request({
    url: `/admin/resource/role/${id}`,
    method: 'get',
  })
}

/**
 * 查询权限列表
 */
export const getProjectResourceByRoleId = (id) => {
  return request({
    url: `/admin/resource/project/${id}`,
    method: 'get',
  })
}

export function getDetail(id) {
  return request({
    url: `/admin/resource/detail/${id}`,
    method: 'get'
  })
}


export function add(data) {
  return request({
    url: '/admin/resource/add',
    method: 'post',
    data
  })
}

export function save(data) {
  return request({
    url: `/admin/resource/update`,
    method: 'post',
    data
  })
}

export function deletes(id) {
  return request({
    url: `/admin/resource/delete/${id}`,
    method: 'get'
  })
}

export function restore(id) {
  return request({
    url: `/admin/resource/restore/${id}`,
    method: 'get'
  })
}


export function getApiresource() {
  return request({
    url: `/apiresource`,
    method: 'get'
  })
}
